package PoJo;

public class Print {
    static volatile String name;

    public String getName() {
        return name;
    }

    private static Print print = null;
    public static  Print getPrint(){
        if(print==null){

            synchronized(Print.class){
                if(print==null){
                    name = "武龙";
                    print = new Print();
                    System.out.println("双重检查单例模式");
                }

            }


        }

        return print;
    }
    private Print(){

    }
}
